Member variable only maintains assigned value for the scope of a function